<local:DocumentBase x:Class="WPFExcelReport.YCAFSPLAN"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"                    
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    
                    FontSize="16"
                   Background="White"
                    Loaded="Window_Loaded"
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:QtyColorConverter  x:Key="qtyc"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetDetail" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <CollectionViewSource   x:Key="vwSECTION" Source="{Binding Path=ICC_SECTION,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwLIEFDAT" Source="{Binding Path=LIEFDAT,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwWDECK" Source="{Binding Path=WDECK,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwFSSTAMM" Source="{Binding Path=FSSTAMM,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwABKOPF" Source="{Binding Path=ICC_ABKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwEKPOS" Source="{Binding Path=ICC_EKPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwABAUFM" Source="{Binding Path=ICC_ABAUFM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwABPOS_MAT" Source="{Binding Path=ICC_ABPOS_MAT,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwMDECKMAT" Source="{Binding Path=ICC_MDECKMAT,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwWDECKMAT" Source="{Binding Path=ICC_WDECKMAT,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwFDECKMAT" Source="{Binding Path=ICC_FDECKMAT,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwGAAUFMAT" Source="{Binding Path=ICC_GAAUFMAT,Source={StaticResource SetDetail}}" />
    </local:DocumentBase.Resources>
    <Grid   >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
            <Expander  
                Name="expLog" ExpandDirection="Down" IsExpanded="True">
                <StackPanel>
                    <WrapPanel Name="zoneCommand" Margin="4,0,51,6" Grid.ColumnSpan="3">
                        <Label Content="{Binding Source={Localization:TranslateExtension Word=系统}}" Width="Auto" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0"   HorizontalAlignment="Left" Background="Pink"  TabIndex="1" >00</TextBox>
                        <Label Content="{Binding Source={Localization:TranslateExtension Word=语言}}" Width="Auto" Margin="0,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                        <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="18" TabIndex="2" />
                        <Label Content="{Binding Source={Localization:TranslateExtension Word=用户名}}" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                        <TextBox Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="18" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                        <Label Content="{Binding Source={Localization:TranslateExtension Word=密码}}" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left"  VerticalAlignment="Center" />
                        <PasswordBox Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow"  KeyboardNavigation.TabIndex="1" TabIndex="4" />
                        <Button Content="{Binding Source={Localization:TranslateExtension Word=登录}}" Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="Auto" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">

                        </Button>
                        <TextBlock Name="Administration"></TextBlock>
                        <CheckBox FontSize="16" Content="{Binding Source={Localization:TranslateExtension Word=属于评审组}}" Name="IsBelongs2V9"
                              Visibility="Hidden"></CheckBox>
                        <TextBlock FontSize="16" MinWidth="200" Width="Auto" Name="MemberV9" Background="#FF00AF00"
                               Visibility="Hidden"></TextBlock>
                        <TextBlock Name="txtLogIn" Width="Auto" Margin="10,0,0,0" HorizontalAlignment="Left" Background="White" FontSize="16" KeyboardNavigation.TabIndex="1" />
                    </WrapPanel> 
                </StackPanel>
            </Expander>
            <WrapPanel>
                <StackPanel>
                    <WrapPanel>
                        <WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=待审核}}" VerticalAlignment="Center" Margin="5,0,10,5" ></TextBlock>
                            <Button  Width="30" Height="30"  Click="btnCheck_Click" Visibility="Hidden" IsEnabled="False">
                                <Button.Background>
                                    <ImageBrush  ImageSource="Image/Refresh.png" />
                                </Button.Background>
                            </Button>

                            <TextBlock VerticalAlignment="Center"  FontSize="18"   Width="59"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=类型}}" />
                            <ComboBox
                    Name="cbWTYE"
                    HorizontalAlignment="Left"
                    IsEditable="True"
                    Background="White"
                    IsTextSearchEnabled="True"
                    IsTextSearchCaseSensitive="False"                           
                    Width="120" 
                            SelectionChanged="cbWTYE_SelectionChanged"
                    >
                                <ComboBoxItem Content="{Binding Source={Localization:Translate Word=成衣}}"/>
                                <ComboBoxItem Content="{Binding Source={Localization:Translate Word=主面料}}"/>
                                <ComboBoxItem Content="{Binding Source={Localization:Translate Word=面辅料}}"/>
                                <ComboBoxItem Content="{Binding Source={Localization:Translate Word=高级辅料}}"/>
                            </ComboBox>
                            <TextBlock VerticalAlignment="Center">波段</TextBlock>
                            <ComboBox Width="100" Name="cbSECTION"
                          DisplayMemberPath="SDDATEN"
                          SelectedValuePath="SDKEY"
                          SelectionChanged="cbSECTION_SelectionChanged"
                         ItemsSource="{Binding Source={StaticResource ResourceKey=vwSECTION}}"  
                          ></ComboBox>
                            
                        </WrapPanel>
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=已确认}}"></TextBlock>
                        <CheckBox Name="ChkEKPBEKZ" IsChecked="False" VerticalAlignment="Center" 
                          Background="White"
                          >
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=辅料已入库}}"> </TextBlock>
                        <CheckBox Name="ChkEKPME3" IsChecked="False" VerticalAlignment="Center" Background="White" IsEnabled="False"
                          >
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=自动推算}}"></TextBlock>
                        <CheckBox Name="ChkAutoBackCalulate" IsChecked="False" VerticalAlignment="Center" 
                                  
                          Background="White"
                          >
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>
                        <WrapPanel Name="ZoneIT" IsEnabled="False">
                            <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=所有}}"></TextBlock>
                            <CheckBox Name="ChkAny" IsChecked="False" VerticalAlignment="Center" 
                          Background="White"
                          >
                                <CheckBox.LayoutTransform>
                                    <ScaleTransform ScaleX="2" ScaleY="2" />
                                </CheckBox.LayoutTransform>
                            </CheckBox>
                            <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=折损}}"></TextBlock>
                            <Button  Width="30" Height="30"   Click="btnQtyCost_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="Image/Open.png" />
                                </Button.Background>
                            </Button>
                        </WrapPanel>
                        
                    </WrapPanel>
         
                    <WrapPanel Name="ZoneNormal" IsEnabled="False">
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=采购单}}"></TextBlock>
                        <TextBox Background="LightGreen"  FontSize="18"    Width="40" Name="txtEKKRS" CharacterCasing="Upper" Margin="10,0,0,0" >WP</TextBox>
                        <TextBox Background="White"  FontSize="18"    Width="80" Name="txtEKLFD" CharacterCasing="Upper" Margin="10,0,0,0"  >000457</TextBox>
                        <Button  Width="30" Height="30"   Click="btnQuery_Click" >
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/Reload.png" />
                            </Button.Background>
                        </Button>
                        <TextBox Background="Yellow"  FontSize="18"    Width="160" Name="txtFSART" CharacterCasing="Upper" Margin="10,0,0,0" Text="" />
                        <Button  Width="30" Height="30"   Click="btnQueryEKPOS_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/Reload.png" />
                            </Button.Background>
                        </Button>
                        <TextBox Background="White"  FontSize="18"    Width="60" Name="txtEKQTy" KeyUp="txtEKQTy_KeyUp" Text="{Binding Path=EKPME1, Source={StaticResource ResourceKey=vwEKPOS}}"  Margin="10,0,0,0"  />
                        <TextBlock Background="White"  FontSize="18"    Width="60" Name="txtEKNQTy" IsEnabled="False"  Margin="10,0,0,0"  />
                        <TextBlock Background="White"  FontSize="18"    Width="40" Name="txtEKMEEh"  Text="{Binding Path=EKPMEEH, Source={StaticResource ResourceKey=vwEKPOS}}"  Margin="10,0,0,0"  />
                        <WrapPanel Name="ZoneManager" IsEnabled="False" Visibility="Hidden">
                            <TextBlock Text="{Binding Source={Localization:TranslateExtension Word=下限}}" Width="Auto"></TextBlock>
                            <TextBox Background="White"  FontSize="18"    Width="60" Name="txtMin"    Margin="10,0,0,0"  >3</TextBox>
                            <TextBlock Text="{Binding Source={Localization:TranslateExtension Word=上限}}" Width="Auto"></TextBlock>
                            <TextBox Background="White"  FontSize="18"    Width="60" Name="txtMax"    Margin="10,0,0,0"  >3</TextBox>
                        </WrapPanel>
                        <TextBox Name="txtSection" Width="220" FontSize="18" Background="Beige" CharacterCasing="Upper" ></TextBox>
                     </WrapPanel>
                    <WrapPanel>
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=价格}}"></TextBlock>
                        <TextBox Background="White"    Margin="10,0,0,0"  Width="60"  VerticalAlignment="Center"
                                 Text="{Binding EKPPRME, Source={ StaticResource ResourceKey=vwEKPOS}, Converter={StaticResource ResourceKey=PreisConverter}}" CharacterCasing="Upper" />
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=交期}}"></TextBlock>
                        <TextBox Background="White"   Margin="10,0,0,0"  Width="120"  VerticalAlignment="Center"
                                 Text="{Binding EKPVTERMIN, Source={ StaticResource ResourceKey=vwEKPOS}}" CharacterCasing="Upper" 
                                     />
                        <TextBlock Background="LightGray"   Margin="10,0,0,0"  Width="120"  VerticalAlignment="Center"
                                 Text="{Binding EKPLTERM, Source={ StaticResource ResourceKey=vwEKPOS}}" 
                                     />
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=最终数量}}"></TextBlock>
                        <CheckBox Name="ChkFixedQty" IsChecked="False" VerticalAlignment="Center" Background="White" 
                          >
                            <CheckBox.LayoutTransform>
                                <ScaleTransform ScaleX="2" ScaleY="2" />
                            </CheckBox.LayoutTransform>
                        </CheckBox>

                        <Button FontSize="18" Height="30" Width="30" Margin="20,0,0,0" Click="btnRefreshEKP_Click" Name="btnRefreshEKP">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/Upload.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=更新采购单}}" Margin="0,0,0,0"  VerticalAlignment="Center" ></TextBlock>
                        <Button  Height="40" Width="40" Margin="10,0,0,0" Name="btnPushQty" Click="btnPushQty_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/Convert.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=自动分配}}" Margin="2,0,0,0" VerticalAlignment="Center" ></TextBlock>
                        <Button Visibility="Collapsed" Name="btnUpdateIntex" Click="btnUpdateIntex_Click" Margin="0,0,0,0" Height="40" Width="40">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/Save.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Visibility="Collapsed" Text="{Binding Source={Localization:Translate Word=投产}}" Margin="10,0,0,0" VerticalAlignment="Center" ></TextBlock>
                        <Button Name="btnApprove" Click="btnApprove_Click" Margin="10,0,0,0" Height="40" Width="40">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/button_ok.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=审核}}" Margin="10,0,0,0" VerticalAlignment="Center" ></TextBlock>
                        <Expander Name="zoneQty" ExpandDirection="Right"  IsExpanded="True" FontSize="18" VerticalAlignment="Center" IsEnabled="False">
                            <WrapPanel VerticalAlignment="Center" >
                                <TextBlock Text="{Binding Source={Localization:Translate Word=包装物抵扣}}" VerticalAlignment="Center" ></TextBlock>
                                <TextBox Name="txtPackgewg" Width="80" VerticalAlignment="Center"  Background="White"></TextBox>
                                <TextBlock VerticalAlignment="Center" >KG</TextBlock>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=比例}}" Margin="10,0,0,0" VerticalAlignment="Center" Background="White" ></TextBlock>
                                <TextBlock Name="txtWidthRatio" Width="80" VerticalAlignment="Center" Foreground="Red"  ></TextBlock>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=成品幅宽}}" Margin="10,0,0,0" VerticalAlignment="Center" ></TextBlock>
                                <TextBlock Name="txtWidth" Width="40"  VerticalAlignment="Center"  Text="{Binding Path=WAFBRTU, Source={StaticResource ResourceKey=vwEKPOS},Converter={StaticResource ResourceKey=d10}}"></TextBlock>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=有效幅宽}}" VerticalAlignment="Center" ></TextBlock>
                                <TextBlock Background="White" Name="txtNWidth" Width="40" VerticalAlignment="Center" Text="{Binding Path=WAFBRTL, Source={StaticResource ResourceKey=vwEKPOS},Converter={StaticResource ResourceKey=d10}}"></TextBlock>
                                <TextBlock VerticalAlignment="Center" >CM</TextBlock>
                                <Button  Click="btnConfirm_Click" Margin="10,0,0,0" Height="40" Width="40">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="Image/button_ok.png" />
                                    </Button.Background>
                                </Button>
                            </WrapPanel>
                        </Expander>
                    </WrapPanel>                    
                </StackPanel>
            </WrapPanel>
        </StackPanel>
        <Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="2*" MinHeight="300"/>
                <RowDefinition Height="1*" /> 
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <DataGrid  Grid.Row="0"  Grid.Column="0"
                    FontSize="12"
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"                  
                                AutoGenerateColumns="False"   
                                EnableRowVirtualization="False"  
                                HorizontalAlignment="Stretch" 
                                HorizontalScrollBarVisibility="Auto"
                                VerticalScrollBarVisibility="Auto"
                                IsSynchronizedWithCurrentItem="True"
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwEKPOS}}"  
                                x:Name="dlgEKPOS" 
                                Margin="0,1,0,0" 
                                RowDetailsVisibilityMode="Visible"
                                >
                    <DataGrid.RowDetailsTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="5">
                                <TextBlock Foreground="CadetBlue" FontSize="16"                         
                            Text="{Binding Path=EKPART, Converter={StaticResource ResourceKey=Trim}}"/>
                                <TextBlock>/</TextBlock>
                                <TextBlock Foreground="CadetBlue" FontSize="16"                             
                            Text="{Binding Path=EKPFARBE, Converter={StaticResource ResourceKey=Trim}}"/>
                                <TextBlock>:</TextBlock>
                                <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=EKPLSART, Converter={StaticResource ResourceKey=Trim}}"/>
                                <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=EKPLSFB, Converter={StaticResource ResourceKey=Trim}}"/>
                                
                            </StackPanel>
                        </DataTemplate>
                    </DataGrid.RowDetailsTemplate>
                    <DataGrid.Columns> 
                        <DataGridTextColumn Binding="{Binding Path=EKPBEKZ}" Header="{Binding Source={Localization:Translate Word=审核}}"   Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=EKPAUFKRS}" Header=""   Width="30" />
                        <DataGridTextColumn Binding="{Binding Path=EKPAUFLFD}" Header="{Binding Source={Localization:Translate Word=采购单}}"   Width="80" />
                        <DataGridTextColumn Binding="{Binding Path=EKPAUFPOS}" Header="{Binding Source={Localization:Translate Word=行号}}"   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=EKPART}" Header="{Binding Source={Localization:Translate Word=品种}}"   Width="80" />
                        <DataGridTextColumn Binding="{Binding Path=EKPFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=EKPGROE}" Header="{Binding Source={Localization:Translate Word=尺寸}}"   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=EKPME1}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=UM}}"   Width="30" />
                        <DataGridTextColumn Binding="{Binding Path=WAFBRTU, Converter={StaticResource ResourceKey=d10}}" Header="{Binding Source={Localization:Translate Word=幅宽}}"   Width="50" />
                        <DataGridTextColumn Binding="{Binding Path=WAFBRTL, Converter={StaticResource ResourceKey=d10}}" Header="{Binding Source={Localization:Translate Word=内幅宽}}"   Width="50" />                        
                    </DataGrid.Columns>
                </DataGrid  >          
             
                <Grid Grid.Row="1"  Grid.Column="0"  Name="zoneMainFabric">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition> 
                    </Grid.RowDefinitions> 
                    <WrapPanel Grid.Row="0">
                        <Button Width="30" Height="30"  Click="btnRemove_Click"  ToolTip="{Binding Source={Localization:Translate Word=可以从此处移除需求，重新产生采购单}}" Visibility="Hidden" >
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/delete.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=本渠道[采购]数量}}"></TextBlock>
                        <TextBox Background="White"  FontSize="18"    Width="120"  Text="{Binding Path=PPQTY, Source={StaticResource ResourceKey=vwABPOS_MAT}}"  Margin="10,0,0,0"    />
                        <TextBlock Text="{Binding Source={Localization:Translate Word=其他渠道}}"></TextBlock>
                        <TextBox Background="White"  FontSize="18"    Width="120"  Text="{Binding Path=HPCQTY, Source={StaticResource ResourceKey=vwABPOS_MAT}}"  Margin="10,0,0,0"  />
                        <TextBlock Text="{Binding Source={Localization:Translate Word=总数量}}"></TextBlock>
                        <TextBlock Background="White"  FontSize="18"    Width="120"    Text="{Binding Path=PPQTY, Source={StaticResource ResourceKey=vwABPOS_MAT}}"  Margin="10,0,0,0"  />
                    </WrapPanel>
                    <DataGrid Grid.Row="1"
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"                  
                                AutoGenerateColumns="False"   
                                EnableRowVirtualization="False"  
                               FontSize="12"
                                Width="Auto"
                                VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True"
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS_MAT}}"  
                                Margin="0,1,0,0" 
                                IsTextSearchCaseSensitive="True" 
                                RowDetailsVisibilityMode="Visible"
                                SelectionUnit="FullRow">
                        <DataGrid.RowDetailsTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="50,0,0,0" HorizontalAlignment="Right">
                                    <TextBlock Foreground="Black" FontSize="12" Text="{Binding Source={Localization:Translate Word=生产单}}"/>
                                    <TextBlock Foreground="Black" FontSize="12" Text="{Binding Path=KRS}"/>
                                    <TextBlock Foreground="Black" FontSize="12" Text="{Binding Path=LFD}"/>
                                    <TextBlock Foreground="Black" FontSize="12" Text="{Binding Source={Localization:Translate Word=意向量}}"/>
                                    <TextBlock Foreground="Black" FontSize="12" Text="{Binding Path=TQTYP}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Source={Localization:Translate Word=S:}}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Path=SP}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Source={Localization:Translate Word=M:}}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=MP}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Source={Localization:Translate Word=L:}}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=LP}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Source={Localization:Translate Word=XL:}}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=XLP}"/>
                                </StackPanel>
                            </DataTemplate>
                        </DataGrid.RowDetailsTemplate>
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=PCQTY}" Header="{Binding Source={Localization:Translate Word=需求}}"   Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=PPQTY}" Header="{Binding Source={Localization:Translate Word=分配}}"   Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=UM}" Header="{Binding Source={Localization:Translate Word=UM}}"   Width="40" />
                            <DataGridTextColumn Binding="{Binding Path=ABPSPGRD}" Header="{Binding Source={Localization:Translate Word=确认}}"   Width="40" />
                            <DataGridTextColumn Binding="{Binding Path=ABPART,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=款式}}"   Width="180" />
                            <DataGridTextColumn Binding="{Binding Path=ABPFARBE,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=TQTY}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="80" >
                                <DataGridTextColumn.ElementStyle>
                                    <Style TargetType="TextBlock">
                                        <Setter Property="Foreground" Value="{Binding Path=DQTY,Converter={StaticResource ResourceKey=qtyc}}"></Setter>
                                        <Setter Property="HorizontalAlignment" Value="Center"></Setter>
                                    </Style>
                                </DataGridTextColumn.ElementStyle>
                            </DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding Path=S}" Header="{Binding Source={Localization:Translate Word=S}}"   Width="60" >
                            </DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding Path=M}" Header="{Binding Source={Localization:Translate Word=M}}"  Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=L}" Header="{Binding Source={Localization:Translate Word=L}}"  Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=XL}" Header="{Binding Source={Localization:Translate Word=XL}}"  Width="60" />
                        </DataGrid.Columns>
                    </DataGrid  >
                </Grid>  
             
            <StackPanel Grid.Row="0"  Grid.Column="1" Grid.RowSpan="2">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <DataGrid Grid.Row="0"
                    CanUserReorderColumns="True"  
                    CanUserResizeRows="True" CanUserSortColumns="True"
                    AutoGenerateColumns="False"   
                    EnableRowVirtualization="True"  
                    RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                    IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwWDECKMAT}}"       
                    Name="WDECKDataGrid"
                    SelectionUnit="FullRow"
                    Grid.ColumnSpan="4" Margin="0,1,0,0"
                       >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=ART}" Header="{Binding Source={Localization:Translate Word=面料}}"   Width="120" />
                            <DataGridTextColumn Binding="{Binding Path=FARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=STQTY, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="80" />
                            <DataGridTextColumn Binding="{Binding Path=UM}" Header="{Binding Source={Localization:Translate Word=UM}}"   Width="60" />
                        </DataGrid.Columns>
                    </DataGrid  >
                    <DataGrid  Grid.Row="1"
                       CanUserReorderColumns="True"  
                       CanUserResizeRows="True" CanUserSortColumns="True"                  
                       AutoGenerateColumns="False"   
                       EnableRowVirtualization="True"  
                       RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" 
                       IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwABAUFM}}"       
                       Name="dlgABAUFM"
                       SelectionUnit="FullRow"
                       VerticalAlignment="Top"
                       MaxHeight="500"
                       Grid.ColumnSpan="1" Margin="0,1,0,0"
                       >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=ABAUFPOS}" Header="{Binding Source={Localization:Translate Word=行}}"   Width="30" />
                            <DataGridTextColumn Binding="{Binding Path=ABAFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="50" />
                            <DataGridTextColumn Binding="{Binding Path=ABARESMG}" Header="{Binding Source={Localization:Translate Word=需求}}"   Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=ABAQTYRESERVE}" Header="{Binding Source={Localization:Translate Word=留位}}"   Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=ABPART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=款号}}"   MinWidth="120" />
                        </DataGrid.Columns>
                    </DataGrid  >
                    <StackPanel Grid.Row="2"  Grid.Column="0">
                        <TextBlock Text="{Binding Source={Localization:Translate Word=消息}}"></TextBlock>
                        <TextBox VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="txtEKP"></TextBox>
                    </StackPanel>
                </Grid>
                
            </StackPanel> 
        </Grid>
    </Grid>
</local:DocumentBase>
